<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=、, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = ["America", "Greece", "Britain", "Canada", "China", "Egypt"];
        var count = 0;
    
        for (var i = 0; i < arr.length; i++) {
          if (arr[i].indexOf("a")!== -1 || arr[i].indexOf("A")!== -1) {
            count++;
          }
        }
    
        document.write("共有 " + count + " 个字符串中包含 a 或 A。");
      </script>
</body>
</html>